package org.zsl.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zsl.dao.mybatis.UserMapper;
import org.zsl.model.ResponseMsg;
import org.zsl.model.User;

import java.util.List;

@Service
public class UserService2 {

    @Autowired
    private UserMapper userMapper;

    public List<User> getList(){

        return  userMapper.selectAll();
    }


    public ResponseMsg register(User user){
        ResponseMsg responseMsg = new ResponseMsg();
        Boolean flag=  userMapper.insert(user)>0;
        responseMsg.setSuccess(flag);
        return  responseMsg;
    }
}
